##Dargite3d

Pong-clone. Pick from one of 12 heroes, each one with different stats.
Pick from one of the several stages.
Add your own heroes and stages or edit existing ones!

Made with C++ and openGL/glut.

##How to play

You control the hero to the left, the computer controls the one on the right. 
Your aim is to protect the ball from hitting the left side of the screen while trying to 
hit your opponent's side. Each time someone hits the ball, it increases in speed. Once the 
ball hits either player's side, it will reset its spead, and will hurt the player 
equal to the opponent's damage.

##Compile

####Linux

#####Ubuntu:

(this should work on all debian based distros - since they all use aptitude package manager)

To compile the project yourself, you need to install the `freeglut3-dev` and the `libglew-dev` packages. Then follow these 3-steps:

    apt-get install freeglut3-dev libglew
	./configure
    make
	make install

Note: `./configure` defaults install destination to `/usr/local/`, this means you will (probably) need to run `make install` with root. 
To change install directory, you can use `./configure -p /new/path/`

#####Arch Linux

You should need `freeglut`, `glew` and `mesa` packages (for 32-bit you might need `lib32-glew` instead of `glew`). 
Then follow these 3-steps:

	pacman -S freeglut mesa glew
	./configure
	make
	make install
									    
Note: `./configure` defaults install destination to `/usr/local/`, this means you will (probably) need to run `make install` with root. 
To change install directory, you can use `./configure -p /new/path/`

#####Other distros

Check online what libraries you need to compile/execute opengl, glew and glut programs. Install the needed libraries. Then follow these 3-steps:

	./configure
	make
	make install

Note: `./configure` defaults install destination to `/usr/local/`, this means you will (probably) need to run `make install` with root. 
To change install directory, you can use `./configure -p /new/path/`

####Other os:
Since I'm new at opengl I'm not sure what libraries you would need to compile opengl for another OS, 
feel free to take a look at `Makefile`, in general you would need the libraries for opengl and glut.

##Mods

The game can be modded with a lot of ways, here are the supported ones:
(By default, all paths specified are inside /usr/local by default - unless you changed it during installation. 
If installed from a package manager (soon), it should be /usr/ instead)

**Change the appearence of existing heroes:** To do that, open your favorite 3D model editor (I like Blender). 
Either import an existing hero from `share/dargite3d/mod/brick_??.ply` (where ?? is the number of the hero) or create one from scratch. 
If you create your own model, make sure to import another existing hero to compare sizes (a too big hero will make the game unplayable). 
Make sure to paint verticles (On blender click `Object Mode` and select `Vertex Paint`). Then export your model as .ply and replace the desired hero's model, 
do not include UVs or Normals. Sorry for the restrictions, my parser is still weak, I'll do my best to improve it at some point (or use an already-made one).

**Change the stats of existing heroes:** This is much simpler, open `share/dargite3d/mod/heroes` using your favorite text editor. 
Read the instructions there. 
Each line is a hero. By reading the template you can understand what each number represents (health, speed etc etc).
Simply change the value to a desired one (following the template's guidelines).

**Add new hero:** On the same file (share/dargite3d/obj/heroes) by simply adding another line, a new hero is created.
To understand how it works, simply copy/paste a line of an already existing hero and run the game.
The new hero is already available for playing.
Following the methods above, you can change the appearence and/or stats of this hero.

**Add new stage:** Open the file `share/dargite3d/mod/stages`. There are detailed instructions of how to add a new stage.
The logic is similar to characters, each line starting with a tilde `~` signals a new stage. Every stage has a path to a 
3D object (.ply) that is used as the stage's ground. (it also sets the stages width and height - so you can make a stage 
bigger or smallre with this. Then there should be two arrays, written between "{" and "}". The first array has paths of 
"obstacles" and two coordinates "x" and "y" of it's location (relative to center). An obstacle is a 3D object that the ball
will collide with. The second array has paths for "environment objects". They are similar to obstacles, but the only difference
is that they don't collide with the ball. They are only there for the visual part of the stage.
